<template>
  <div class="tabbar">
    <router-link tag="div" :to="item.uri" v-for="(item,index) in tab_list" :key="index">
      <i class="iconfont" :class="item.icon"></i>
      <span>{{item.title}}</span>
    </router-link>
  </div>
</template>

<script>
export default {
  data () {
    return {
      tab_list: [
        {uri: '/', icon: 'icon-shouye', title: '首页'},
        {uri: '/category', icon: 'icon-fenlei', title: '分类'},
        {uri: '/shop', icon: 'icon-iconsongshubi', title: '松鼠币商城'},
        {uri: '/cart', icon: 'icon-gouwuche', title: '购物车'},
        {uri: '/user', icon: 'icon-user', title: '个人中心'}
      ]
    }
  }
}
</script>

<style scoped>
.tabbar{
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  border-top: 1px solid #ccc;
  display: flex;
}
.tabbar div{
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.tabbar div.router-link-exact-active{
  color: #77bc1f;
}
.tabbar div .iconfont{
  font-size: 21px;
  line-height: 32px;
}
.tabbar div span{
  color: #585858;
}
</style>



